<%@ page language="java" pageEncoding="ISO-8859-1"%>
<%@page import="com.printeverywhere.dto.User"%>
<%@page import="java.util.List"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib uri="http://displaytag.sf.net" prefix="display"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<s:actionmessage cssClass="note-red" />
	<s:form action="addSubscribers.htm" method="post" theme="simple" name="form" id="form">

		<table width="100%">
			<tbody>
				<tr>
					<td height="40" class="sectionheading bottom-border">
						Add New Subscribers
					</td>
				</tr>
				<tr>
					<td height="8">
					</td>
				</tr>
				<tr>
					<td align="center"
						class="verdana12darkgreybold">
						Select the mailing lists to add subscribers
						<br>
						<br>
						<s:select name="groupId" list="groupList" listKey="groupId"
							listValue="name" multiple="false" size="6" cssClass="Textfiled-border" onclick="form.submit();"></s:select>

					</td>
				</tr>
				<tr>
					<td>

						<display:table name="addSubscriberUserList" pagesize="5" cellpadding="0" cellspacing="0" requestURI="showAddNewSubscribers.htm" id="row" class="verdana12blacknormal">
								<display:column title="#" headerClass="Table-Head">
									<c:out value="${row_rowNum}" />
								</display:column>
								<display:column headerClass="Table-Head" property="userId" title="User" />
								<display:column headerClass="Table-Head" property="region.categoryName" title="Region" />
								<display:column headerClass="Table-Head" property="country.categoryName" title="Country" />
								<display:column headerClass="Table-Head" title="Status" >
									<input type="checkbox" id="status"
										name="subscribedUser" value="<%=((User) row).getId()%>" <%= ((User) row).isChecked() ? "checked" : "" %>>
									<% if(((User) row).isChecked()){ %>
									<input type="hidden" name="checkedId" value="<%=((User) row).getId()%>">
									<%} %>
								</display:column>
						</display:table>
				</td>
				</tr>
				<tr><td>&nbsp;</td></tr>
				<tr>
					<td align="center"
						class="verdana12darkgreybold">
							<s:submit theme="simple" type="image" src="../Admin-Images/submit-btn.gif" value="Submit" name="submit" />
							<img onclick="document.getElementById('form').reset();" style="cursor: pointer;" src="../Admin-Images/reset-button.gif" alt="Reset" />
						&nbsp;
					</td>
				</tr>
			</tbody>
		</table>
	</s:form>
